$(function() {
	var name = $('.name');
	var Yname = $('.Yname');
	var gundong
	//循环参加名单
	function startNum() {
		// 时时更新pcount人数
		var pcount = bossArray.length - 1;
		var num = Math.floor(Math.random() * pcount);
		console.log(bossArray[num])
		name.html(bossArray[num].name);
		gundong = setTimeout(startNum, 50);
	}
	//startNum()
	$('.bossBtn').click(function() {
		if ($('.bossBtn').text() == '开始') {
			$('.bossBtn').text('结束')
			startNum()
		} else {
			$('.bossBtn').text('开始')
			clearTimeout(gundong)
		}
	})
	function startYNum() {
		// 时时更新pcount人数
		var pcount = personArray.length - 1;
		var num = Math.floor(Math.random() * pcount);
		console.log(personArray[num])
		Yname.html(personArray[num].address+' '+ personArray[num].name);
		gundong = setTimeout(startYNum, 50);
	}
	//startNum()
	$('.YBtn').click(function() {
		if ($('.YBtn').text() == '开始') {
			$('.YBtn').text('结束')
			startYNum()
		} else {
			$('.YBtn').text('开始')
			clearTimeout(gundong)
		}
	})
	$('#open').click(function() {
		
	})
})
